gtk-demo: Clean up toolpalette drawing code
authorBenjamin Otte <otte@redhat.com>
Mon, 27 Sep 2010 18:49:06 +0000 (20:49 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 27 Sep 2010 18:49:06 +0000 (20:49 +0200)
Fix compile warning and use cairo_paint() instead of querying the widget
size and cairo_fill()ing it.

demos/gtk-demo/toolpalette.c

index 537fddd41a74e3564239faaa39011d63bf617b63..49efd57f333f7d510bb676ba6a7f23b3c1c75c16 100644 (file)
@@ -84,15 +84,10 @@ static gboolean
 canvas_draw (GtkWidget *widget,
              cairo_t   *cr)
 {
-  GtkAllocation allocation;
   GList *iter;
-  gint width, height;
 
   cairo_set_source_rgb (cr, 1, 1, 1);
-  width = gtk_widget_get_allocated_width (widget);
-  height = gtk_widget_get_allocated_height (widget);
-  cairo_rectangle (cr, 0, 0, width, height);
-  cairo_fill (cr);
+  cairo_paint (cr);
 
   for (iter = canvas_items; iter; iter = iter->next)
     canvas_item_draw (iter->data, cr, FALSE);